package day1110.strategy;

import com.sun.corba.se.spi.orb.Operation;

/**
 * @author Mr.ma
 * @since 2022/11/10 16:42
 * 策略模式测试
 **/
public class StrategyTest {
    public static void main(String[] args) {
        OperationContext add = new OperationContext(new OperationAdd());
        System.out.println("10 + 5 = " + add.executeStrategy(10, 5));
        OperationContext subtract = new OperationContext(new OperationSubtract());
        System.out.println("10 - 5 = " + subtract.executeStrategy(10, 5));
        OperationContext multiply = new OperationContext(new OperationMultiply());
        System.out.println("10 * 5 = " + multiply.executeStrategy(10, 5));
    }
}
